package com.yunhe.common.constant;

/**
 * @ClassName OfficeConts
 * @Description TODO
 * @Author HeTao
 * @Date 2021/6/24 14:52
 * @Version 1.0
 **/
public class OfficeConts {

    // 单位代码定义
    public enum OFFICE_STATUS_CODE {
        Vacant("01", "空置"),
        Booking("02", "预订"),
        Rented("03", "已租"),
        Sold("04", "已售"),
        ;
        private String value;
        private String title;
        OFFICE_STATUS_CODE(String value, String title) {
            this.value = value;
            this.title = title;
        }
        public String value() {
            return value;
        }
        public String title() {
            return title;
        }
        public static String getTitle(String value) {
            OFFICE_STATUS_CODE[] values = values();
            for (OFFICE_STATUS_CODE officeStatusCode : values) {
                if(officeStatusCode.value().equals(value)){
                    return officeStatusCode.title();
                }
            }
            return null;
        }
    }

    // 厂房形态定义
    public enum OFFICE_TYPE{
        SteelStructure("01", "钢结构"),
        BrickConcreteStructure("02", "砖混结构"),
        FrameStructure("03", "框架结构"),
        SteelBrickConcreteStructure("04", "钢结构+砖混结构"),
        ;
        private String value;
        private String title;
        OFFICE_TYPE(String value, String title){
            this.value = value;
            this.title = title;
        }
        public String value() {
            return value;
        }
        public String title() {
            return title;
        }
        public static String getTitle(String value) {
            OFFICE_TYPE[] values = values();
            for (OFFICE_TYPE officeType : values) {
                if(officeType.value().equals(value)){
                    return officeType.title();
                }
            }
            return null;
        }
        public static String getValue(String title){
            OFFICE_TYPE[] office_types = values();
            for (OFFICE_TYPE office_type : office_types) {
                if ((office_type.title).equals(title)){
                    return office_type.value();
                }
            }

            return null;
        }
    }

    // 装修情况定义
    public enum DECORATION{
        Rough("01","清水"),
        Simple("02","简装"),
        Refined("03","精装"),
        ;
        private String value;
        private String title;
        DECORATION(String value, String title){
            this.value = value;
            this.title = title;
        }
        public String value() {
            return value;
        }
        public String title() {
            return title;
        }
        public static String getTitle(String value) {
            DECORATION[] values = values();
            for (DECORATION decoration : values) {
                if(decoration.value().equals(value)){
                    return decoration.title();
                }
            }
            return null;
        }
        public static String getValue(String title){
            DECORATION[] decorations = values();
            for (DECORATION decoration : decorations) {
                if ((decoration.title).equals(title)){
                    return decoration.value();
                }
            }
            return null;
        }
    }

    // 厂房类型定义
    public enum HOUSING_TYPE{
        FactoryWork("01", "厂房+办公"),
        Factory("02", "厂房"),
        Work("03", "办公"),
        Business("04", "商业"),
        Apartment("05", "公寓"),
        Others("06", "其他");
        private String value;
        private String title;
        HOUSING_TYPE(String value, String title) {
            this.value = value;
            this.title = title;
        }
        public boolean equals(String value) {
            return this.value().equals(value);
        }
        public static HOUSING_TYPE byValue(String value) {
            HOUSING_TYPE[] values = HOUSING_TYPE.values();
            for (HOUSING_TYPE item : values) {
                if (item.equals(value)) {
                    return item;
                }
            }
            return null;
        }
        public String value() {
            return value;
        }
        public String title() {
            return title;
        }
    }

    // 厂房层数定义
    public enum OFFICE_FLOOR_COUNT_TYPE{
        OneLayer("01", "单层"),
        TwoLayer("02", "双层"),
        ThreeLayer("03", "三层");
        private String value;
        private String title;
        OFFICE_FLOOR_COUNT_TYPE(String value, String title){
            this.value = value;
            this.title = title;
        }
        public String value() {
            return value;
        }
        public String title() {
            return title;
        }
        public static String getTitle(String value) {
            OFFICE_FLOOR_COUNT_TYPE[] values = values();
            for (OFFICE_FLOOR_COUNT_TYPE officeFloorCountType : values) {
                if(officeFloorCountType.value().equals(value)){
                    return officeFloorCountType.title();
                }
            }
            return null;
        }
        public static String getValue(String title){
            OFFICE_FLOOR_COUNT_TYPE[] office_floor_count_types = values();
            for (OFFICE_FLOOR_COUNT_TYPE office_floor_count_type : office_floor_count_types) {
                if ((office_floor_count_type.title).equals(title)){
                    return office_floor_count_type.value();
                }
            }
            return null;
        }
    }
}


